// index.js
// 获取应用实例
import brandApi from '../../api/brand'

const app = getApp()

Page({
  data: {
    freshing:false,
    triggered:true,
    moreLoading:false,
    allFlg:false,
    arr:[],
    show:false,
    param:''
  },
  onLoad(data) {

    this.prodSearch()
   
  },
  prodSearch() {
    brandApi.brandList().then((res)=>{
        this.setData({
          arr:res
        })
    })
  },
  onUnload() {
    // 解绑
    // this.storeBindings.destroyStoreBindings()
  },
  onRefresh() {
    if (this.freshing) return
    this.freshing = true
    console.log("onRefresh---下拉-----")
    setTimeout(() => {
      this.setData({
        triggered: false,
      })
      this.freshing = false
    }, 3000)
  
  },
  scrollBottom() {

  },
  onClose() {

  },
  onClick() {
    let data1 = this.data.formData.formData
    data1.param = this.data.param
    this.prodSearch(data1)
  },
  onListClick(e) {
    let  a = e.currentTarget.dataset.item
    wx.navigateTo({
      url: '../prodList/prodList?id='+a.id
    })
   
  }


})
